﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace peta
{
    class Client
    {
        private int varsta;
        private string nume;
        private List<Car> masini = new List<Car>();


        public Client(string nume, int varsta)
        {
            this.varsta = varsta;
            this.nume = nume;
        }

        public string getNume()
        {
            return nume;
        }
        
        public void showInfoClient()
        {
            Console.Write("\nnume: " + nume);
            Console.WriteLine("    varsta: " + varsta.ToString());
           
        }
        public void stergeMasina()
        {
            int contor = 1;
            foreach (Car Car in masini)
            {
                Console.Write(contor.ToString() + ". ");
                Car.showInfoCar();
                contor++;
            }
            Console.WriteLine("A cata masina?");
            masini.RemoveAt(Int32.Parse(Console.ReadLine())-1);
        }

        public void showCarList()
        {
            int contor = 1;
            if (masini.Count() == 0)
                Console.WriteLine("Acest client nu are nicio masina achizitionata!");
            Console.WriteLine();
            foreach (Car Car in masini)
            {
                Console.Write(contor.ToString()+". ");
                Car.showInfoCar();
                contor++;
            }
        }


        public void adaugaCar(Car m)
        {
            masini.Add(m);
        }
    }
   
}
